package game.communication;

import game.Person;
import game.util.TraitUtil.Trait;

import java.util.List;
import java.util.Vector;

public class GreetingCommunication extends Communication {
	private Person responder;

	public GreetingCommunication(String greeting, Person responder) {
		super(greeting);
		this.responder = responder;
	}

	@Override
	public List<Communication> getReplies() {
		List<Communication> replies = new Vector<Communication>();

		List<Trait> receiverTraits = responder.getTraits();
		for (Trait receiverTrait : receiverTraits) {
			List<String> greetingsReply = receiverTrait.getGreetingsReply();
			for (String greetingReply : greetingsReply) {
				replies.add(new ReplyCommunication(greetingReply));
			}
		}
		return replies;
	}
}
